package com.evil.common.application.dto.robot.rule;

import com.evil.common.application.enums.robot.RobotRuleSourceTypeEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Map;

/**
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CopyRobotRuleReqDTO {

    private Long enterpriseId;

    /**
     * 复制源
     */
    private RobotRuleSourceDTO source;

    /**
     * 复制目标
     */
    private RobotRuleSourceDTO target;

    /**
     * 控件id替换映射
     */
    private Map<Long, Long> controlIdMap;

    /**
     * 更新源信息
     */
    private Boolean updateSource;

    public CopyRobotRuleReqDTO(RobotRuleSourceTypeEnum robotRuleSourceTypeEnum, Long enterpriseId, Long sourceId, Long targetId, Boolean updateSource) {
        this.enterpriseId = enterpriseId;
        this.source = new RobotRuleSourceDTO(robotRuleSourceTypeEnum, sourceId);
        this.target = new RobotRuleSourceDTO(robotRuleSourceTypeEnum, targetId);
        this.updateSource = updateSource;
    }

    public CopyRobotRuleReqDTO(RobotRuleSourceTypeEnum robotRuleSourceTypeEnum, Long enterpriseId, Long sourceId, Long targetId, Map<Long, Long> controlIdMap, Boolean updateSource) {
        this.enterpriseId = enterpriseId;
        this.source = new RobotRuleSourceDTO(robotRuleSourceTypeEnum, sourceId);
        this.target = new RobotRuleSourceDTO(robotRuleSourceTypeEnum, targetId);
        this.controlIdMap = controlIdMap;
        this.updateSource = updateSource;
    }
}
